package com.nimitz.module.drip.service.impl;

import com.nimitz.module.drip.domain.DriBusiness;
import com.nimitz.module.drip.mapper.DriBusinessMapper;
import com.nimitz.module.drip.service.IDriBusinessService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 日营业额 业务层实现
 */
@Service
public class DriBusinessServiceImpl implements IDriBusinessService {

    @Resource
    private DriBusinessMapper businessMapper;

    /**
     * 生成日营业额
     *
     * @param brandName 品牌名称
     * @param orderDate 订单日期
     * @return 结果
     */
    @Override
    public int generateBusiness(String brandName, String orderDate) {
        return 0;
    }

    /**
     * 根据订单类型和订单日期条件查询日营业额
     *
     * @param brandName 品牌名称
     * @param orderType 订单类型
     * @param orderDate 订单日期
     * @return 日营业额集合
     */
    @Override
    public List<DriBusiness> selectBusinessListByOrderTypeAndOrderDate(String brandName, Integer orderType, String orderDate) {
        return businessMapper.selectBusinessListByOrderTypeAndOrderDate(brandName, orderType, orderDate);
    }

    /**
     * 修改日营业额现金流水状态
     *
     * @param brandName   品牌名称
     * @param businessIds 日营业额ID集合
     * @return 结果
     */
    @Override
    public int updateBusinessByCashStatus(String brandName, List<Integer> businessIds) {
        return businessMapper.updateBusinessByCashStatus(brandName, businessIds);
    }

    /**
     * 修改日营业额权责收入状态
     *
     * @param brandName   品牌名称
     * @param businessIds 日营业额ID集合
     * @return 结果
     */
    @Override
    public int updateBusinessByDutyStatus(String brandName, List<Integer> businessIds) {
        return businessMapper.updateBusinessByDutyStatus(brandName, businessIds);
    }
}
